/* GUI CONVERTED from sotriq03.p (converter v1.75) Sat Aug 12 17:30:15 2000 */
/* sotriq03.p - SALES ORDER BOOKING HISTORY BY PART                     */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* web convert sotriq03.p (converter v1.00) Fri Oct 10 13:58:05 1997 */
/* web tag in sotriq03.p (converter v1.00) Mon Oct 06 14:18:47 1997 */
/*F0PN*/ /*K1JT*/ /*                                                    */
/*V8:ConvertMode=Report                                        */
/* REVISION: 1.0      LAST MODIFIED: 06/11/86   BY: PML */
/* REVISION: 2.1      LAST MODIFIED: 08/27/87   BY: WUG *A94* */
/* REVISION: 2.1      LAST MODIFIED: 01/02/88   BY: pml remove *A94*/
/* REVISION: 4.0      LAST MODIFIED: 12/30/87   BY: WUG *A137* */
/* REVISION: 5.0      LAST MODIFIED: 03/20/89   BY: MLB *B069*/
/* REVISION: 5.0      LAST MODIFIED: 05/03/89   BY: WUG *B098* */
/* REVISION: 6.0      LAST MODIFIED: 07/13/91   BY: afs *D769**/
/* REVISION: 7.3      LAST MODIFIED: 11/06/92   BY: afs *G286**/
/* Revision: 7.3    Last edit: 11/19/92     By: jcd *G345* */
/* REVISION: 8.6      LAST MODIFIED: 02/26/98   BY: *K1JT* Beena Mol    */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00   BY: *N0KN* myb              */

/*K1JT*/ /* DISPLAY TITLE */

/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

/*K1JT*/ {mfdtitle.i "b+ "}

define variable part like tr_part.
define variable trnbr like tr_trnbr.
define variable addr like tr_addr.
define variable trdate like tr_effdate.

/*K1JT* /* DISPLAY TITLE */
 * {mfdtitle.i "b+ "} /*G286*/ */

part = global_part.


/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   part
   addr
   trdate
with frame a no-underline
/*K1JT*/ width 80 THREE-D /*GUI*/.

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

/*K1JT*/ {wbrp01.i}

repeat with frame a:

/*D769*/ if trdate = low_date then trdate = ?.

/*K1JT*/ if c-application-mode <> 'web' then
   update part addr trdate with frame a editing:

      if frame-field = "part" then do:
     /* FIND NEXT/PREVIOUS RECORD */
     {mfnp.i pt_mstr part pt_part part pt_part pt_part}

     if recno <> ? then do:
        part = pt_part.
        display part with frame a.
     end.
      end.
      else do:
     status input.
     readkey.
     apply lastkey.
      end.
   end.

/*K1JT*/ {wbrp06.i &command = update &fields = "  part addr trdate" &frm = "a"}

/*K1JT*/ if (c-application-mode <> 'web') or
/*K1JT*/ (c-application-mode = 'web' and
/*K1JT*/ (c-web-request begins 'data')) then do:

   hide frame b.
   hide frame c.
   hide frame d.

/*K1JT*/ end.

   /* SELECT PRINTER */
   {mfselprt.i "terminal" 80}


    {hksimsg.i """" """"}   /*fdn*/

   if trdate = ? then trdate = low_date.

   if part <> "" then repeat for tr_hist with frame b width 80:

        /* SET EXTERNAL LABELS */
        setFrameLabels(frame b:handle).
        
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
                 /*G345*/
      find prev tr_hist where tr_part = part
      and tr_effdate >= trdate AND LOOKUP(tr_site,GLOBAL_user_site) > 0
        no-lock use-index tr_part_eff.
      if tr_type = "ORD-SO" and (tr_addr = addr or addr = "" ) then
      display tr_part tr_trnbr tr_effdate tr_ship_type
      tr_addr
      tr_nbr
/*B069*/ format "x(8)"
      tr_qty_req WITH STREAM-IO /*GUI*/ .
   end.

   else if addr <> "" then repeat for tr_hist with frame c width 80:

        /* SET EXTERNAL LABELS */
        setFrameLabels(frame c:handle).
        
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
                 /*G345*/
      find prev tr_hist where tr_addr = addr
      and tr_effdate >= trdate  AND LOOKUP(tr_site,GLOBAL_user_site) > 0
    no-lock use-index tr_addr_eff.
      if tr_type = "ORD-SO" then
      display tr_part tr_trnbr tr_effdate tr_ship_type
      tr_nbr tr_qty_req WITH STREAM-IO /*GUI*/ .
   end.

   else repeat for tr_hist with frame d width 80:

        /* SET EXTERNAL LABELS */
        setFrameLabels(frame d:handle).
        
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/
                 /*G345*/
      find prev tr_hist where tr_type = "ORD-SO"
      and tr_effdate >= trdate  AND LOOKUP(tr_site,GLOBAL_user_site) > 0
    no-lock use-index tr_type.
      display tr_part tr_trnbr tr_effdate tr_ship_type tr_addr
      tr_nbr format "x(8)" tr_qty_req WITH STREAM-IO /*GUI*/ .
   end.

/*G286*/ {mfreset.i}
/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/

/*G286*/ {mfmsg.i 8 1}

end.
/*G286** {mfreset.i}   **/
/*G286** {mfmsg.i 8 1} **/
global_part = part.

/*K1JT*/ {wbrp04.i &frame-spec = a}
